<?php

class Company extends Eloquent{


     protected $fillable = array('name','content','pics');
     protected $guard = array();


	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'company';

    
    public static function getCompanyPics($companyid)
    {

       $settings = parse_ini_file(app_path()."\config\GLOBALS.ini",true);
       

       if($settings ){

       $maxcompanypics =  $settings['page_parameter']['MAXCompanyPICS'];
      
               
       $company     = Company::find($companyid)->first();

       if($company ){

           $pics        = explode(";",  $company->pics);
          
           $picsnumber  =  count($pics);

           $pic['maxcompanypics']  	=  $maxcompanypics;	
           $pic['picsnumber'] 		= $picsnumber ;
	         $pic['pics'] 			= $pics ;
        
           return $pic;

        }
        else{
          echo "can not find this company";

        }
      }else
      {

          
      }



    }

}
